home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / i-cstrin.ads < prev    next >
Text File  |  1994-05-19  |  3KB  |  84 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                 I N T E R F A C E S . C . S T R I N G S                  --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. with System.Storage_Elements;
  26.  
  27. package Interfaces.C.Strings is
  28.  
  29.    type Char_Array_Ptr is access all Char_Array;
  30.  
  31.    type Chars_Ptr is private;
  32.  
  33.    Null_Ptr : constant Chars_Ptr;
  34.  
  35.    function To_Chars_Ptr
  36.      (Item       : in Char_Array_Ptr;
  37.       Null_Check : in Boolean := False)
  38.       return       Chars_Ptr;
  39.  
  40.    function Allocate_Chars (Chars   : in Char_Array) return Chars_Ptr;
  41.  
  42.    function Allocate_String (Str : in String) return Chars_Ptr;
  43.  
  44.    procedure Free (Item : in out Chars_Ptr);
  45.  
  46.    Null_Dereference : exception;
  47.  
  48.    function Value (Item : in Chars_Ptr) return Char_Array;
  49.  
  50.    function Value
  51.      (Item   : in Chars_Ptr;
  52.       Length : in Natural)
  53.       return   Char_Array;
  54.  
  55.    function Value (Item : in Chars_Ptr) return String;
  56.  
  57.    function Value
  58.      (Item   : in Chars_Ptr;
  59.       Length : in Natural)
  60.       return   String;
  61.  
  62.    function Strlen (Item : in Chars_Ptr) return Natural;
  63.  
  64.    procedure Update
  65.      (Item   : in Chars_Ptr;
  66.       Offset : in Natural;
  67.       Chars  : in Char_Array;
  68.       Check  : Boolean := True);
  69.  
  70.    procedure Update
  71.      (Item   : in Chars_Ptr;
  72.       Offset : in Natural;
  73.       Str    : in String;
  74.       Check  : in Boolean := True);
  75.  
  76.    Update_Error : exception;
  77.  
  78. private
  79.    type Chars_Ptr is new System.Storage_Elements.Integer_Address;
  80.  
  81.    Null_Ptr : constant Chars_Ptr := To_Integer (System.Null_Address);
  82.  
  83. end Interfaces.C.Strings;
  84.